<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%
	StringBuffer strURL = request.getRequestURL();
	String URL = strURL.toString();
	String contPath = request.getContextPath();
	int nIndex = URL.indexOf(contPath);
	URL = "http://tugo.cn/weixin_aef/";
	%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="<%=URL%>newedition/css/aui.css" />
<link rel="stylesheet" href="<%=URL%>newedition/css/iconfont.css" />
<link rel="stylesheet" href="<%=URL%>newedition/css/aui-slide.css" />
<link rel="stylesheet" href="<%=URL%>newedition/css/user_Comment.css" />
<link rel="stylesheet" href="<%=URL%>newedition/css/aui-pull-refresh.css" />
<script type="text/javascript" src="<%=URL%>newedition/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/aui-slide.js"></script>
<script type="text/javascript" src="<%=URL%>js/base64.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/aui-toast.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/auipopupstyle.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/base.js?version=3.4"></script>
<script type="text/javascript" src="<%=URL%>js/cookies.js?version=1.1"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/aui-pull-refresh.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/doRefresh.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/aui-dialog.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/recycle/startScore.js" ></script>
<title>服务评价</title>
	</head>

	<body>
		<header class="aui-bar aui-bar-nav">
			<!-- <a class="aui-pull-left aui-btn" >
				<span class="aui-iconfont aui-icon-left"></span>
			</a> -->
			<div class="aui-title">服务评价</div>
			<a class="aui-pull-right aui-btn">
				<span class="aui-iconfont aui-icon-more"></span>
			</a>
		</header>
		<div class="aui-refresh-content">
			<div class="main01 aui-padded-15 aui-margin-b-15">
				<div class="aui-row">
					<div class="aui-col-xs-4 main01-left">
						<img src="" id="hearderimg"/>
					</div>
					<div class="aui-col-xs-8 main01-right">
						<div class="Comment-main01-name"  id="realname">李四</div>
						<div class="Comment-main01-info">
							<span>服务等级：<span class="info-LV">LV4</span></span>
							<span>服务次数：<span class="info-frequency" id="num">52</span>次</span>
						</div>
					</div>
				</div>
			</div>
			<div class="main02 aui-margin-b-15">
				<span class="main-title aui-padded-5">服务评价</span>
				<div class="main-content">
					<div class="aui-row main02-list">
						<div class="aui-col-xs-3 main02-list-left">服务态度：</div>
						<div class="aui-col-xs-7 main02-list-center" id="appraisal1">
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
						</div>
						<div class="aui-col-xs-2 main02-list-right"><span id="serve">0</span>分</div>
					</div>
					<div class="aui-row main02-list">
						<div class="aui-col-xs-3 main02-list-left">收油速度：</div>
						<div class="aui-col-xs-7 main02-list-center" id="appraisal2">
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
						</div>
						<div class="aui-col-xs-2 main02-list-right"><span id="speed">0</span>分</div>
					</div>
					<div class="aui-row main02-list">
						<div class="aui-col-xs-3 main02-list-left">收油价格：</div>
						<div class="aui-col-xs-7 main02-list-center" id="appraisal3">
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
							<i class="icon iconfont icon-star"></i>
						</div>
						<div class="aui-col-xs-2 main02-list-right"><span id="price">0</span>分</div>
					</div>
				</div>
			</div>
			<div class="main03 aui-margin-b-15">
				<span class="main-title aui-padded-5">服务评价</span>
				<div class="main-content">
					<textarea id="content" onfocus="if(value=='填写您的想法和建议...'){value=''}" onblur="if (value ==''){value='填写您的想法和建议...'}"></textarea>
				</div>
			</div>
			<div class="submit aui-padded-15">
				<button onclick="submitfunction()">提交评价</button>
			</div>
		</div>
	</body>
	<script>
	<%String phone = (String) request.getParameter("phone");%>
	<%String orderId = (String) request.getParameter("orderId");%>
	$(function(){
		GetSingleOpenIdForMobile( <%=phone%>);
	})
		scoreFun($("#appraisal1"))
		scoreFun($("#appraisal2"))
		scoreFun($("#appraisal3"))
		function submitfunction(){
			showDefault("loading","添加中...");
			var one=$("#serve").html();
			var two=$("#speed").html();
			var three=$("#price").html();
			var four=$("#content").val();
			if(one==0||two==0||three==0){
				toast.hide();
				showDefault("fail","请对收运人员评价");
			}else{
				var jsonadd = '[{"one": "'+one+'","two":"'+two+'","three":"'+three+'","four":"'+four+'","mobile":"<%=phone%>","phone":"'+getCookie("useriphone")+'","orderId":"<%=orderId%>"}]';
				$.ajax({
						type: "post",
						datatype: 'json',
						contentType: 'application/json;charset=UTF-8',
						url: 'http://118.178.18.0:8082/alfa-mobile-ws/rest/ordercomment/batchinsertordercomment?mobiletoken='+getCookie("mobiletokenuser")+'',
						data: jsonadd,
						success: function(data) {
							toast.hide();
							
							if(data.message=="1"){
							 	location.href="user_infoNotes.jsp" 
							}else{
							}
						}
				})
			}
		}
	function GetSingleOpenIdForMobile(mobile) {
		showDefault("loading","加载中...");
		var json = '{"mobile": "'+mobile+'"}';
		$.ajax({
				type: "post",
				datatype: 'json',
				contentType: 'application/json;charset=UTF-8',
				url: ''+httpipstr+'alfa-mobile-ws/rest/OpenId/GetSingleOpenIdForMobile?mobiletoken='+getCookie("mobiletokenuser")+'',
				data: json,
				success: function(data) {
					toast.hide();
					if(data.message=="1"){
						$("#realname").html(data.data.realname);
						$("#num").html(data.total);
						$("#hearderimg").attr('src',data.data.headimgurl);
						/* $("#realname").html(data.data.rows.realname); */
					}else{
					}
				}
		})
	}
		dorefresh();
	</script>

</html>